Recently, a semiconductor device has been miniaturized and highly functionalized. Thus, the minute structural difference of a transistor included in a semiconductor device makes a great influence on the performance of the semiconductor device. Generally, a transistor includes a polysilicon gate electrode. However, in order to satisfy performance requirements, the polysilicon gate electrode has been replaced by a metal gate electrode. As a process of forming the metal gate electrode, there may be a gate last process or a replacement gate process.